/**
 * Copyright (C) 2009 Noel Ang
 *
 * This file is part of Samsara.
 *
 * Samsara is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * Samsara is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with Samsara.  If not, see <http://www.gnu.org/licenses/>.
 ******************************************************************************/
package com.lunarshades.samsara.ui;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

/**
 * Annotation for indicating that a method represents a column. By convention,
 * this annotation should be used on methods that return a value, and declare no
 * parameters.
 * <p/>
 * {@see RosterTableModel#findColumns}
 */
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.METHOD)
public @interface TableColumn {

/**
 * The ordering number for the annotated item. An item X with an ordering number
 * less than or equal to item Y's ordering number is considered "less" than Y,
 * and this is used in implementation-specific ways (e.g., item ordering in a
 * table model).  An ordering number should be zero or a positive number.
 * <p/>
 * An item with an ordering number of {@link TableColumn#RELATIVE} indicates
 * that the utilizing implementation is free to assign an arbitrary value to the
 * item.
 *
 * @return Ordering number for the item
 */
int value() default TableColumn.RELATIVE;

public static final int RELATIVE = -1;
}
